/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.magicland;

/**
 *
 * @author eduardo
 */
public class Config {
    
    
    public static String path = "";
    public static String OS ="";
    
    public static final boolean Debug = false;
    
    
    public boolean isWindownsOS(){
		
		return   (Config.OS.indexOf("win") >= 0) ? true : false ;
		 
	}
	
	
    public boolean isMacOS(){
            return   (Config.OS.indexOf("mac") >= 0) ? true : false ;
    }
	
    public Config( ){
		
            Config.path = getClass().getProtectionDomain().getCodeSource().getLocation().toString();
            Config.OS = System.getProperty("os.name").toLowerCase();

            if(Config.Debug)
                    System.out.println("#Origianl path#:"+Config.path);

            //path
            if(isMacOS()){
                    if(Config.Debug)
                            System.out.println("#OS::MAC");
                   Config.path = Config.path.replaceFirst("file:", "");
            }
            else if(isWindownsOS()){


                    if(Config.Debug)
                          System.out.println("#OS::WIN");
                    Config.path = Config.path.replaceFirst("file:/","/" );
            }


             if(Config.Debug)
                    System.out.println("#Resource path#" +Config.path);
    }
       
}     